import os   
import platform
CPPPATH=[]
sources=[]
env=DefaultEnvironment().Clone()
OS_NAME=platform.system()
LIB_DIR=os.environ['LIB_DIR'];

CPPPATH=['nativefiledialog/src', 'nativefiledialog/src/include']

sources=['nativefiledialog/src/nfd_common.c']
if OS_NAME == 'Windows':
  sources+=['nativefiledialog/src/nfd_win.cpp']
elif OS_NAME == 'Linux':
  CPPPATH +=[
    '/usr/include/gtk-3.0',
    '/usr/include/dbus-1.0',
    '/usr/lib/x86_64-linux-gnu/dbus-1.0/include',
    '/usr/include/gio-unix-2.0/',
    '/usr/include/pango-1.0',
    '/usr/include/atk-1.0',
    '/usr/include/cairo',
    '/usr/include/pixman-1',
    '/usr/include/gdk-pixbuf-2.0',
    '/usr/include/glib-2.0',
    '/usr/lib/glib-2.0/include',
    '/usr/lib/i386-linux-gnu/glib-2.0/include',
    '/usr/lib/x86_64-linux-gnu/glib-2.0/include',
    '/usr/include/ibus-1.0']

  sources+=['nativefiledialog/src/nfd_zenity.c', 'nativefiledialog/src/nfd_gtk.c']
elif OS_NAME == 'Darwin':
  sources+=['nativefiledialog/src/nfd_cocoa.m']

CCFLAGS=os.environ['CCFLAGS'];
env.Library(os.path.join(LIB_DIR, 'nfd'), sources, CPPPATH = CPPPATH, CCFLAGS = CCFLAGS)

